from flask_sqlalchemy import SQLAlchemy
from flask import Flask
from flask_cors import CORS
import constants

app = Flask(__name__,template_folder='./templates',static_folder="./static")

app.config['SQLALCHEMY_DATABASE_URI'] = constants.databaseType \
                                        + "://" + constants.databaseUsername \
                                        + ":" + constants.databasePassword \
                                        + "@" + constants.databaseUrl \
                                        + "/" + constants.databaseName

app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
app.config["SQLALCHEMY_COMMIT_TEARDOWN"] = True

CORS(app, supports_credentials=True)

db = SQLAlchemy(app)
